﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace ServiceDeskClient
{
    /// <summary>
    /// Interaction logic for SelectUser.xaml
    /// </summary>
    public partial class SelectUserWindow : Window
    {
        internal SelectUserWindow(IEnumerable<MainWindow.Model.UserItem> users)
        {
            InitializeComponent();
            DataContext = users.ToList();
        }
        public Guid? Result;

        private void Ok_Click_1(object sender, RoutedEventArgs e)
        {
            var user = UsersList.SelectedValue as MainWindow.Model.UserItem;
            if(user!=null)
            {
                Result = user.Guid;
                DialogResult = true;
                Close();
            }
        }
    }
}
